<template>
    <div>
        <div class="right-box">
            <myTitle title="一氧化碳传感器"></myTitle>
            <div class="right-box-content">
                <div
                    v-for="(item, index) in monooxygenData"
                    :key="index"
                    class="right-box-content-item"
                >
                    <el-row :gutter="20">
                        <el-col :span="12">
                            <div>{{ item.object_cn_name }}</div>
                        </el-col>
                        <el-col :span="12">
                            <span
                                >CO浓度：{{
                                    Number(item.present_value).toFixed(2)
                                }}</span
                            >
                        </el-col>
                    </el-row>
                </div>
            </div>
        </div>
    </div>
</template>
<script>
import { number } from "echarts";
import myTitle from "../../components/title.vue";
import { getCoConcentrationRanking } from "@/api/sendhttp/baKanban";
export default {
    components: { myTitle },
    name: "rightBox",
    data() {
        return {
            monooxygenData: [],
        };
    },
    created() {},
    mounted() {
        this.getData();
    },
    methods: {
        async getData() {
            const {
                data: { code, data, msg },
            } = await getCoConcentrationRanking();
            if (code === "200") {
                this.monooxygenData = data;
            } else {
                this.$message({
                    message: msg,
                    type: "error",
                });
            }
        },
    },
};
</script>
<style lang="scss" scoped>
.right-box {
    height: 400px;
    background-color: rgba(241, 243, 245, 1);
    overflow-y: auto;
    .right-box-content {
        font-size: 12px;
        padding: 0px 20px 20px 20px;
        .right-box-content-item {
            // border-bottom: 1px solid #ccc;
            margin-top: 20px;
            span {
                color: #58a55c;
            }
        }
    }
}
/* @import url(); 引入css类 */
</style>
